﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraReports.UI;
using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UserDesigner;
using System.IO;
using DevExpress.XtraReports.UI;
using Report;

namespace Report
{
    public partial class FrmReportView : Form
    {
        #region Variables
        private XtraReport XReport;
        public DataTable _dtDataSource = new DataTable();
        public string _reportName = string.Empty;
        #endregion

        #region Inits
        public FrmReportView()
        {
            InitializeComponent();
        }
        #endregion

        #region GetReportPath(XtraReport fReport, string ext)
        private static string GetReportPath(XtraReport fReport, string ext)
        {
            System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
            string repName = fReport.Name;
            if (repName.Length == 0)
                repName = fReport.GetType().Name;
            string dirName = Path.GetDirectoryName(asm.Location);
            return Path.Combine(dirName, String.Format("{0}.{1}", repName, ext));
        }
        #endregion

        #region _load_XtraTKSLSachTheoTheLoai
        //public void _load_XtraTKSLSachTheoTheLoai(DataTable _dtData, string _Ngayky)
        //{
        //    _dtDataSource = _dtData;
        //    this.Text = "Thống kế số lượng sách theo thể loại sách";
        //    XtraReports.XtraTKSLSachTheoTheLoai prints = new XtraReports.XtraTKSLSachTheoTheLoai();
        //    XReport = prints;
        //    if (File.Exists(GetReportPath(XReport, "repx")))
        //        XReport.LoadLayout(GetReportPath(XReport, "repx"));
        //    prints.Init_XtraTKSLSachTheoTheLoai(_dtData, _Ngayky);
        //    printControl.PrintingSystem = prints.PrintingSystem;
        //    prints.CreateDocument();
        //}
        #endregion

    }
}